//
//  TUIGroupSystemTipMessageCellData.m
//  MarryBackEnd
//
//  Created by mac on 2020/10/12.
//  Copyright © 2020 WPP. All rights reserved.
//

#import "TUIGroupSystemTipMessageCellData.h"

@implementation TUIGroupSystemTipMessageCellData
- (instancetype)initWithDirection:(TMsgDirection)direction
{
    if (self = [super initWithDirection:direction]) {
        
        /*
         感谢使用婚前婚后！ 为提升您的使用体验,避免纠纷等情况出现，平台将对您与商家的互动内容进行第三方监管，我们将尽全力保护您的个人
         */
        
        NSMutableAttributedString *titleAttributes = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"感谢使用婚前婚后！\n 为提升您的使用体验,避免纠纷等情况出现，平台将对您与商家的互动内容进行第三方监管，我们将尽全力保护您的个人信息及合法权益，再次感谢您的信任!"]];

        [titleAttributes addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:14] range:NSMakeRange(0, 9)];
        [titleAttributes addAttribute:NSForegroundColorAttributeName value:UIColorHex(0xff4242) range:NSMakeRange(44, 7)];
        [titleAttributes addAttribute:NSForegroundColorAttributeName value:UIColorHex(0xff4242) range:NSMakeRange(58, 13)];
        
        titleAttributes.lineSpacing = 5;
        
        self.cutStr = titleAttributes;
        
        self.contentFrame = CGRectMake(20, 15, TTScreenWidth - 72, [YYTextLayout layoutWithContainerSize:CGSizeMake(TTScreenWidth - 72, MAXFLOAT) text:titleAttributes].textBoundingSize.height);
        
        self.contentFrame = CGRectMake(16, 15, TTScreenWidth - 32, 140*(TTScreenWidth - 32)/343);
    }
    return self;
}
- (CGSize)contentSize
{
    //return CGSizeMake(TTScreenWidth - 32, CGRectGetMaxY(self.contentFrame) + 10);
    return CGSizeMake(TTScreenWidth - 32, CGRectGetMaxY(self.contentFrame));
}
@end
//保护您的个人信息以及合法权益
